[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
clearviewport() Erase the Current Viewport
#include <graphics.h>
void far clearviewport(void);
clearviewport() clears the current viewport. The current position
(CP) is returned to home position (0,0).
Returns: Nothing.
-------------------------------- Example ---------------------------------
The following statements establish a viewport and draws two
rectangles in the viewport. The viewport is cleared and one more
rectangle is drawn in it.
#include <graphics.h>
#include <conio.h>
main()
{
int gdriver = DETECT;
int gmode;
initgraph(&gdriver,&gmode,"");
setviewport(0,0,400,200,1);
rectangle(100,50,300,100);
rectangle(200,25,400,75);
getch();
clearviewport();
rectangle(300,50,400,100);
getch();
closegraph();
}
See Also:
cleardevice()
getviewsettings()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson